import { Loading } from 'element-ui';
//loading加载
const screenfull = {
  /*
  全屏显示
  */
  requestFullScreen: function (id, callback) {
    var element = document.getElementById(id);
    var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
    requestMethod.call(element);
    callback && callback(element);
  },
  /*
  全屏退出
  */
  exitFullscreen: function (id,callback) {
    var elem = document;
    var elemd = document.getElementById(id);
    if (elem.webkitCancelFullScreen) {
      elem.webkitCancelFullScreen();
    } else if (elem.mozCancelFullScreen) {
      elemd.mozCancelFullScreen();
    } else if (elem.cancelFullScreen) {
      elem.cancelFullScreen();
    } else if (elem.exitFullscreen) {
      elem.exitFullscreen();
    } else {
      //浏览器不支持全屏API或已被禁用
    };
    callback && callback();
  }
}
export default screenfull;
